package StudyCode.summary.zipfile;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class ReadFileInByteArrayUsingFileInputStream {
	public static void main(String[] args) {
		File file = new File("E:/Copy/2.txt");

		try {
			FileInputStream fin = new FileInputStream(file);

			byte fileContent[] = new byte[(int) file.length()];

			fin.read(fileContent);

			String strFileContent = new String(fileContent);

			System.out.println("文件内容 : ");
			System.out.println(strFileContent);

		} catch (IOException ioe) {
			ioe.printStackTrace();
		}
	}
}
